var allEntrust=({
	getList : function (pageNum){
		$$.showPreloader("加载中");
		$.ajax({
			type : "POST",
			dataType : 'json',
			url : "../houseEntrust/getList.do",
			data : {
				searchText : $("#keyword").val(),
				pageSize : 10,
				offset : pageNum
			},
			success : function(data) {
				console.log(data);
				var html="";
				if(pageNum ==0){
					$("#peoplelist").html("");
				}
				if(data.rows!=null && data.rows.length>0){
					for(var i=0;i<data.rows.length;i++){
						html+="<ul><li class=\"item-content\" onclick=\"toLink('entrustAppoDetail.html?houseId="+data.rows[i].houseId+"')\">";
						html+=" <div class=\"item-media\">";
				        html+=" </div><div class=\"item-inner\"> <div class=\"item-title-row\">";
				        html+="<div class=\"item-title\">"+data.rows[i].nickName+"  委托 【 "+data.rows[i].houseName+"】</div>";
				        html+=" </div></li> </ul>";
					}
				}else{
					html+="<ul><li class=\"item-content\">";
					  html+=" 暂无数据...</li> </ul>";
					  $("#loadmore").hide();
				}
				$("#peoplelist").append(html);
				$$.hidePreloader();
			},
			error: function(){
				$$.hidePreloader();
			}
		});
	},
	getDtailById : function (){
		$.ajax({
			type : "POST",
			dataType : 'json',
			url : "../houseEntrust/getById.do",
			data : {
				houseId : houseId
			},
			success : function(data) {
				console.log(data);
				$("#houseAddr").text(data.address);
				$("#houseName").text(data.houseName);
				$("#nickName").text(data.nickName);
				$("#phone").text(data.phone);
				$("#area").text(data.houseName);
				$("#appliances").text(data.appliances);
				$("#handlerRemark").text(data.userRemark);
				$("#houseSize").text(data.houseSize);
				$("#houseLayout").text(data.houseLayout);
				$("#status").text(statusArr[data.status]);
				$("#opt_status").val(data.status);
				$("#entrustType").text(entrustTypeArr[data.entrustType]);
			},
			error: function(){
				$$.hidePreloader();
			}
		});
	},
	edit : function (){
		$$.showPreloader("修改中");
		$.ajax({
			type : "POST",
			dataType : 'json',
			url : "../houseEntrust/updateStatus.do",
			data : {
				houseId : houseId,
				status : $("#opt_status").val()
			},
			success : function(data) {
				$$.hidePreloader();
				if(data.success){
					$$.alert("修改成功");
					allEntrust.getDtailById();
				}
				
			},
			error: function(){
				$$.hidePreloader();
			}
		});
	}
})